<include file="__THEME__/header" />
<link rel="stylesheet" href="../Public/bug.css" type="text/css" media="screen" charset="utf-8" />
<div class="content">
  <!-- 内容 begin  -->
  <include file="__THEME__/apps" />
  <div class="main">
    <!-- 画布 begin  -->
    <div class=page_title>
      <!-- page_title begin -->
      <h2><span class="f12px fn right"><a href="javascript:history.back( -1 )"><<返回上一页</a></span><img src="{$APPINFO['APP_ICON']}" />{$APPINFO['APP_CNNAME']}</h2>
      <div class="c"></div>
    </div>
    <div class="tab-menu"><!-- 切换标签 begin  -->
  	<div class="right mt5">
  		<form method="post" action="__APP__/Index/search">
  		<input type="text" class="TextH20" id="title" onFocus="this.className='Text2'" onBlur="this.className='TextH20'" size="25" name="keywords" value="{$keywords}"/>
		<input type="submit" value="搜索Bug"  class="btn_b"/>
		</form>
	</div>    
      <ul>
        <li><a href="__APP__/Index"><span>全部Bug</span></a></li>
        <li><a href="__APP__/Index/my" ><span>我发布的Bug</span></a></li>
        <li><a href="#"  class="on" ><span>查看详情</span></a></li>        
        <li><a href="__APP__/Bug/add" ><span><div class="ico_add">&nbsp;</div>发布新Bug</span></a></li>
        <php>if($isbugadmin){</php><li><a href="__APP__/Index/manage"><span>内部管理</span></a></li><php>}</php>
      </ul>
    
    </div><!-- 切换标签 end  -->    
   <div class="LogList" style="margin-top:10px;">
        <!-- Bug 内容开始 -->
        <div class="issue" >
          <div class="tit"><span class="right fn f12px pr5"><php>if($mid==$buginfo['uid'] OR $isbugadmin){</php>
                <a href="__APP__/Bug/edit/id/{$buginfo.id}">编辑</a> <a href="__APP__/Bug/dodel/id/{$buginfo.id}">删除</a>
                <php>}</php>
                <PHP>if($_GET['type']!='r' && $isbugadmin){</PHP>
            <span class="wn"> <input type="button" onclick="dotype(1)" class="btn_b" value="指派" />&nbsp;<input type="button" onclick="dotype(2)" class="btn_b" value="处理" />
            
            </span>
            <PHP>}</PHP></span>{$buginfo.state|getStateInfo} </div>
          <div style="padding:0 10px;">
              <h3 class="f16px lh35"><strong>{$buginfo.title}</strong><span style="margin-left:10px;font-size:12px;"><a href="__TS__/space/{$buginfo.uid}">{$buginfo.uname}</a> <span class="cGray2">{$buginfo.cTime|friendlyDate}</span></h3>
              <div style="padding:0 0 20px 0px;" class="blog_con lh180" id="issue">{$buginfo.content|stripslashes}</div>
              <div style="width:100%; padding:5px 0;"><div style="width:25%;" class="left cBlue"><strong>版本号：</strong>{$buginfo.edition|getEditionName}</div><div style="width:25%;" class="left cBlue"><strong>类型：</strong>{$buginfo.catid|getCategoryName}</div><div style="width:25%;" class="left cBlue"><strong>浏览器：</strong>{$buginfo.browser}</div><div style="width:25%;" class="left cBlue"><strong>安装环境：</strong>{$buginfo.setting}</div>
			  <div class="c"></div>
			  </div>
              <!--  以前推荐的地方 -->

        </div>
        </div>
        <div style="height:10px;"></div>
        
<PHP>if($buginfo['reply']){</PHP>
        <div class="solution">
        <div class="tit">官方处理</div>
        <div style="padding:10px;"  id="solution">
          <div class="lh180" id="blog_con">{$buginfo.reply}</div>
          <neq name ="attach" value="">
            <div class="adjunct_list">
              <h2>附件:</h2>
              <volist name ="attach" id="vo"></volist>
              <p class="cGray2"><a href="__TS__/Attach/index/id/{$vo['id']}/uid/{$vo.userId}">{$vo['name']}</a></p>
              </volist>
            </div>
          </neq>
          </div>
        </div>
<PHP>}</PHP>
      
        <div style="height:10px;"></div>
        <div class="issue log">
          <div class="tit">官方操作日志:</div>
            <ul>
              <volist id="vo" name="bugloglist">
                <li><a href="__TS__/space/{$vo.uid}">{$vo.uid|getUserName}</a> {$vo.content} {$vo.cTime|friendlyDate}</li>
              </volist>
            </ul>
          </div>
          <div style="height:10px;"></div>
        <PHP>if($_GET['type']=='r'){</PHP>
        <form action="__APP__/Bug/dotype" method="POST">
          <input type="hidden" name="id" value="{$buginfo.id}">
          <input type="hidden" name="type" value="sopite">
          <ul class="edit" style="width:100%">
            <li style="padding:0;">
              <div class="c1"> 内容： </div>
              <div class="c2"> {:W("Edit",array('smileList'=>$smileList,'smilePath'=>$smilePath,'content'=>$buginfo['reply']))} </div>
            </li>
           <li style="padding:0;">
                    <div class="c1">
                        附件：
                    </div>
                    <div class="c2">
                    <neq name ="attach" value="">
                    <volist name ="attach" id="vo">
                    	<p id="attach_{$vo.id}"><a onclick='$("#attach_"+{$vo.id}).remove()' href="javascript:void(0)" class="attach2771">[删除]</a> <span class="attach2771">{$vo['name']}</span><input type="hidden" name="attach[]" value="{$vo['id']}|{$vo['name']}"></p>
                    </volist>
                    </neq>
						{:W( 'UploadAttach',array( 'uid'=>$mid , 'type'=>'bug' , 'callback'=>'attach_upload_success') )}
                    </div>
                    <div class="attach"></div>
                </li>  
           <li style="padding:0;">
                <div class="c1">
                    状态：
                </div>
                <div class="c2">
                    <select name="state">
                    	<php>foreach(getStateInfo() as $key=>$val){</php>
                    	   <php>$selected = ($key==3)?'selected':''</php>
                    		<option value="{$key}" {$selected}>{$val}</option>
                    	<php>}</php>
                    </select>
                </div>
            </li>                          
           <li style="padding:0;">
              <div class="c1"> &nbsp; </div>
              <div class="c2">
                <input type="submit" class="btn_b" value="提 交" />
                <input type="button" class="btn_b" value="返 回" onclick="javascript:history.back( -1 )" />
              </div>
            </li>
          </ul>
        </form>
        <PHP>}else{</PHP>
        {:W('Comment',array( 'type'=>'bug','appid'=>$buginfo['id'],'mid'=>$uid,"face"=>getUserFace( $mid ),'role'=>'' ))}
        <PHP>}</PHP>
      </div>
  </div>
  <!-- 画布 end  -->
  <div class="c"></div>
</div>
<!-- 内容 end -->
<script>

function photo_size(name){
	$(name+" img").each(function(){
		var width = 400;
		var height = 400;
		var image = $(this);
		if (image.width() > image.height()){
		   if(image.width()>width){
			image.width(width);
			image.height(width/image.width()*image.height());
		   }
		}
		else{
		   if(image.height()>height){
			image.height(height);
			image.width(height/image.height()*image.width());
		   }
		}
		  image.addClass('hand');
		  image.bind('click',function(){
                   window.open(image.attr('src'),'_blank');
                });
	});
}

photo_size('#issue');
photo_size('#solution');

function dotype(val){
	if(val=='1'){
		ymPrompt.win(getCooptContent(),400,300,'选择指派人员');
	}else{
		location.href = '__APP__/Bug/view/type/r/id/{$buginfo.id}';
	}
}

function getCooptContent(){
var html = '<div class="pop" id="pop_network"><form action="__APP__/Bug/dotype" method="post"><input type="hidden" name="type" value="coopt"><input type ="hidden" name="id" value="{$buginfo.id}">'+
		   '<div class="ulist">'+
		   <PHP>foreach($adminlist as $val){
		       echo "\'<li><input type=checkbox name=userId[] value=".$val."> ".getUserName($val)."\</li>'+";
		   }</PHP>
		   '<div>'+
           '<input name="input" type="submit" class="btn_b" value="确 定"/>'+
           '<input name="input2" type="button" class="btn_w" value="取 消" onclick="ymPrompt.close();" /></div>'+
           '</form></div>';
	return html;
}
function commentSuccess(json){
    //计数
    $.post(APP+'/Bug/commentSuccess',{
        data:json
    },function(result){
        
    });
}
</script>
<style>
.ulist{
	height:480px;
}
</style>
<include    file="__THEME__/footer" /> 